﻿/*
 * File: TwoDeeGamePlayBaseScene_otherDraw.cs
 * Author: Gourav Das
 * Purpose: Base Draw Scene for 2D gameplay
 * Created: May30 2011
 */

using System;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Threading;
using System.IO;
using _22yards._2D;
using _22yards.Scenes.Helpers;
using _22yards.Core;
using _22yards;
using _22yards.EnumDeclarations;
using _22yards.ThreeD;
using _22yards.Helpers;

namespace _22yards.Scenes
{
    

    /// <summary>
    /// This is a scene that implements the 2D Gameplay screen
    /// </summary>
    partial class GamePlayBaseScene : Scene
    {

        /// <summary>
        /// Draw2s the D scene.
        /// </summary>
        private void Draw2DScene()
        {
            sceneEngine.GraphicsDevice.SetRenderTarget(RenderTarget1);
            RenderTarget1.GraphicsDevice.Clear(Color.DarkSlateBlue);

            DrawBase2DScene();
            DrawDefaultViewPortItems();

            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            OriginalViewPortTexture = RenderTarget1;

            sceneEngine.GraphicsDevice.Viewport = RtViewPort;

            if (bShowMobile || bMobileAppear || bMobileDissappear)
            {
                ///////////////////////////////////////
                //Scene1
                //////////////////////////////////////
                sceneEngine.GraphicsDevice.SetRenderTarget(RenderTarget2);
                RenderTarget2.GraphicsDevice.Clear(Color.DarkSlateBlue);
                sceneEngine.SpriteBatch.Begin();
                {
                    sceneEngine.SpriteBatch.Draw(backgroundTexture, new Rectangle(0, 0, RtViewPort.Width, RtViewPort.Height), new Rectangle(RtViewPort.X, RtViewPort.Y, RtViewPort.Width, RtViewPort.Height), Color.White);
                }
                sceneEngine.SpriteBatch.End();

                if (ReliefMapping)
                    rightSideBarModel.Technique = "POMMappingNoShadow";
                else
                    rightSideBarModel.Technique = "NormalMappingNoShadow";
                rightSideBarModel.Draw(staticCamera, Matrix.Identity);
                DisplayRemainingPhotoFrames();
                sceneEngine.GraphicsDevice.SetRenderTarget(null);
                RtViewPortTexture1 = RenderTarget2;
            }

            if (bShowField || bMobileAppear || bMobileDissappear)
            {
                //////////////////////////////////////////////
                //// SCENE 2
                /////////////////////////////////////////////

                sceneEngine.GraphicsDevice.SetRenderTarget(RenderTarget3);
                RenderTarget3.GraphicsDevice.Clear(Color.DarkSlateBlue);
                sceneEngine.SpriteBatch.Begin();
                {
                    sceneEngine.SpriteBatch.Draw(backgroundTexture, new Rectangle(0, 0, RtViewPort.Width, RtViewPort.Height), new Rectangle(RtViewPort.X, RtViewPort.Y, RtViewPort.Width, RtViewPort.Height), Color.White);
                }
                sceneEngine.SpriteBatch.End();

                if (ShowShadows)
                {
                    ShadowMapTexture = GetShadowTexture(birdEyeViewChaseCamera);
                    LeftStumpFarEnd.ShadowMapTexture = ShadowMapTexture;
                    RightStumpFarEnd.ShadowMapTexture = ShadowMapTexture;
                    CenterStumpFarEnd.ShadowMapTexture = ShadowMapTexture;
                    LeftStumpNearEnd.ShadowMapTexture = ShadowMapTexture;
                    RightStumpNearEnd.ShadowMapTexture = ShadowMapTexture;
                    CenterStumpNearEnd.ShadowMapTexture = ShadowMapTexture;
                    LeftBailFarEnd.ShadowMapTexture = ShadowMapTexture;
                    RightBailFarEnd.ShadowMapTexture = ShadowMapTexture;
                    LeftBailNearEnd.ShadowMapTexture = ShadowMapTexture;
                    RightBailNearEnd.ShadowMapTexture = ShadowMapTexture;
                    KBRedBall.ShadowMapTexture = ShadowMapTexture;
                    stadia.ShadowMapTexture = ShadowMapTexture;
                    Pitch.ShadowMapTexture = ShadowMapTexture;
                    LeftStumpFarEnd.Technique = "NormalMappingWithShadow";
                    RightStumpFarEnd.Technique = "NormalMappingWithShadow";
                    CenterStumpFarEnd.Technique = "NormalMappingWithShadow";

                    LeftStumpNearEnd.Technique = "NormalMappingWithShadow";
                    RightStumpNearEnd.Technique = "NormalMappingWithShadow";
                    CenterStumpNearEnd.Technique = "NormalMappingWithShadow";

                    LeftBailFarEnd.Technique = "NormalMappingWithShadow";
                    RightBailFarEnd.Technique = "NormalMappingWithShadow";
                    LeftBailNearEnd.Technique = "NormalMappingWithShadow";
                    RightBailNearEnd.Technique = "NormalMappingWithShadow";
                    KBRedBall.Technique = "NormalMappingWithShadow";
                    stadia.Technique = "NormalMappingWithShadow";
                    Pitch.Technique = "NormalMappingWithShadow";
                }
                else
                {
                    LeftStumpFarEnd.Technique = "NormalMappingNoShadow";
                    RightStumpFarEnd.Technique = "NormalMappingNoShadow";
                    CenterStumpFarEnd.Technique = "NormalMappingNoShadow";

                    LeftStumpNearEnd.Technique = "NormalMappingNoShadow";
                    RightStumpNearEnd.Technique = "NormalMappingNoShadow";
                    CenterStumpNearEnd.Technique = "NormalMappingNoShadow";

                    LeftBailFarEnd.Technique = "NormalMappingNoShadow";
                    RightBailFarEnd.Technique = "NormalMappingNoShadow";
                    LeftBailNearEnd.Technique = "NormalMappingNoShadow";
                    RightBailNearEnd.Technique = "NormalMappingNoShadow";
                    KBRedBall.Technique = "NormalMappingNoShadow";
                    stadia.Technique = "NormalMappingNoShadow";

                    if (ReliefMapping)
                    {
                        //Pitch.SetModelMeshHeightMapTextureMaterial("pitch", TexPitchHeight);
                        //Pitch.SetModelMeshNormalMapTextureMaterial("pitch", TexPitchNormal);
                        //Pitch.HeightScale += 0.01f;
                        Pitch.Technique = "POMMappingNoShadow";
                    }
                    else
                    {
                        //Pitch.SetModelMeshNormalMapTextureMaterial("pitch", TexPitchNormal);
                        Pitch.Technique = "NormalMappingNoShadow";
                    }
                }

                stadia.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                //Fielder1.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                Pitch.Draw(birdEyeViewChaseCamera, Matrix.Identity);

                LeftStumpFarEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                RightStumpFarEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                CenterStumpFarEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                LeftStumpNearEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                RightStumpNearEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                CenterStumpNearEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);

                LeftBailFarEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                RightBailFarEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                LeftBailNearEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                RightBailNearEnd.Draw(birdEyeViewChaseCamera, Matrix.Identity);

                if (KBRedBall != null)
                {
                    Vector3 x = new Vector3(1,0,0);
                    KBRedBall.Draw(birdEyeViewChaseCamera, Matrix.Identity);
                    sceneEngine.SpriteBatch.Begin();
                    {
                        x = sceneEngine.GraphicsDevice.Viewport.Project(KBRedBall.Position, birdEyeViewChaseCamera.ProjectionMatrix, birdEyeViewChaseCamera.ViewMatrix, Matrix.Identity);
                        sceneEngine.SpriteBatch.Draw(TwoDeeBall, new Vector2(x.X - (float)Math.Sqrt((float)(TwoDeeBall.Height * TwoDeeBall.Height + TwoDeeBall.Width * TwoDeeBall.Width)) / 2.0f, x.Y - (float)Math.Sqrt((float)(TwoDeeBall.Height * TwoDeeBall.Height + TwoDeeBall.Width * TwoDeeBall.Width)) / 2.0f), null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1f);
                    }
                    sceneEngine.SpriteBatch.End();
                    
                }

                DisplayRemainingPhotoFrames();

                sceneEngine.GraphicsDevice.SetRenderTarget(null);

                RtViewPortTexture2 = RenderTarget3;
            }

            sceneEngine.GraphicsDevice.Viewport = NormalViewPort;
            SpriteBatch sb = sceneEngine.SpriteBatch;
            sb.Begin(SpriteSortMode.Immediate, BlendState.Opaque);
            sb.Draw(OriginalViewPortTexture, new Vector2(0f, 0f), Color.White);
            sceneEngine.GraphicsDevice.Viewport = RtViewPort;

            if (bMobileAppear && bShowField)
            {
                //make mobile appear
                float fadeBetweenScenes = ((float)Math.Sin(MathHelper.ToRadians(TransitionValue)));

                PostEffect.Parameters["fFadeAmount"].SetValue(fadeBetweenScenes);
                PostEffect.Parameters["fSmoothSize"].SetValue(0.05f);
                PostEffect.Parameters["ColorTexture"].SetValue(RtViewPortTexture2);

                PostEffect.CurrentTechnique = PostEffect.Techniques[1];
                PostEffect.CurrentTechnique.Passes[0].Apply();
                {
                    sceneEngine.SpriteBatch.Draw(RtViewPortTexture1, new Rectangle(0, 0, NormalViewPort.Width, NormalViewPort.Height), Color.White);
                }
                if (fadeBetweenScenes >= 0.95f)
                {
                    bShowMobile = true;
                    bMobileDissappear = false;
                    bMobileAppear = false;
                    bShowField = false;
                    TransitionValue = 0.0f;
                }
            }
            else if (bMobileDissappear && bShowField)
            {
                // Apply the post process shader
                float fadeBetweenScenes = ((float)Math.Sin(MathHelper.ToRadians(TransitionValue)));

                PostEffect.Parameters["fFadeAmount"].SetValue(fadeBetweenScenes);
                PostEffect.Parameters["fSmoothSize"].SetValue(0.05f);
                PostEffect.Parameters["ColorTexture"].SetValue(RtViewPortTexture1);

                PostEffect.CurrentTechnique = PostEffect.Techniques[1];
                PostEffect.CurrentTechnique.Passes[0].Apply();
                {
                    sceneEngine.SpriteBatch.Draw(RtViewPortTexture2, new Rectangle(0, 0, NormalViewPort.Width, NormalViewPort.Height), Color.White);
                }
                if (fadeBetweenScenes >= 0.95f)
                {
                    bShowMobile = false;
                    bMobileDissappear = false;
                    bMobileAppear = false;
                    bShowField = true;
                    TransitionValue = 0.0f;
                }
            }
            else if (bShowMobile)
            {
                sceneEngine.SpriteBatch.Draw(RtViewPortTexture1, new Rectangle(0, 0, NormalViewPort.Width, NormalViewPort.Height), Color.White);
            }
            else if (bShowField)
            {
                sceneEngine.SpriteBatch.Draw(RtViewPortTexture2, new Rectangle(0, 0, NormalViewPort.Width, NormalViewPort.Height), Color.White);
            }
            sb.End();
            sceneEngine.GraphicsDevice.Viewport = NormalViewPort;

            // If the game is transitioning on or off, fade it out to black.
            if (TransitionPosition > 0 || pauseAlpha > 0)
            {
                float alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, pauseAlpha / 2);

                sceneEngine.FadeBackBufferToBlack(alpha);
            }

        }

        /// <summary>
        /// Animates the info bar sliding effect. Also sets the string to be displayed in Infobar to the first message
        /// in message store
        /// </summary>
        private void AnimateInfoBarSlidingEffect()
        {
            //expand infobar and shrink ride sidebar
            if (bStartSidebarShrinkingTransition)
            {
                if (iRightSidebarCurrentheight > iRightSidebarEndheight)
                {
                    iRightSidebarCurrentheight -= (int)((float)RIGHTSIDEBARSPEED * Game22Yards.scaleFactor.htScale);
                    iLeftEnclosureCurrentPosition -= (int)((float)RIGHTSIDEBARSPEED * Game22Yards.scaleFactor.htScale);
                }
                else
                {
                    int tmp = iRightSidebarStartheight;
                    iRightSidebarStartheight = iRightSidebarEndheight;
                    iRightSidebarEndheight = tmp;

                    tmp = iLeftEnclosureStartPosition;
                    iLeftEnclosureStartPosition = iLeftEnclosureEndPosition;
                    iLeftEnclosureEndPosition = tmp;

                    bStartSidebarShrinkingTransition = false;
                    bStartInfobarExpandTransition = true;

                    iRightSidebarCurrentheight = iRightSidebarStartheight;
                    iLeftEnclosureCurrentPosition = iLeftEnclosureStartPosition;
                }
            }
            if (bStartInfobarExpandTransition)
            {
                if (iInfobarCurrentwidth < iInfobarEndWidth)
                {
                    iInfobarCurrentwidth += (int)((float)INFOBARSPEED * Game22Yards.scaleFactor.widthScale);
                }
                else
                {
                    int tmp = iInfobarEndWidth;
                    iInfobarEndWidth = iInfoBarStartwidth;
                    iInfoBarStartwidth = tmp;
                    bStartInfobarExpandTransition = false;
                    iInfobarCurrentwidth = iInfoBarStartwidth;
                    bInfobarExpanded = true;
                    sInfoBarMessage = Game22Yards.DynMsgStore.Messages[0].Msg;
                }
            }


            //shrink infobar and expand ride sidebar
            if (bStartInfobarShrinkTransition)
            {
                if (iInfobarCurrentwidth > iInfobarEndWidth)
                {
                    bInfobarExpanded = false;
                    iInfobarCurrentwidth -= (int)((float)INFOBARSPEED * Game22Yards.scaleFactor.widthScale);
                }
                else
                {
                    int tmp = iInfobarEndWidth;
                    iInfobarEndWidth = iInfoBarStartwidth;
                    iInfoBarStartwidth = tmp;
                    bStartInfobarShrinkTransition = false;
                    bStartSidebarExpandTransition = true;
                    iInfobarCurrentwidth = iInfoBarStartwidth;
                }
            }
            if (bStartSidebarExpandTransition)
            {
                if (iRightSidebarCurrentheight < iRightSidebarEndheight)
                {
                    iLeftEnclosureCurrentPosition += (int)((float)RIGHTSIDEBARSPEED * Game22Yards.scaleFactor.htScale);
                    iRightSidebarCurrentheight += (int)((float)RIGHTSIDEBARSPEED * Game22Yards.scaleFactor.htScale);
                }
                else
                {
                    int tmp = iRightSidebarStartheight;
                    iRightSidebarStartheight = iRightSidebarEndheight;
                    iRightSidebarEndheight = tmp;

                    tmp = iLeftEnclosureStartPosition;
                    iLeftEnclosureStartPosition = iLeftEnclosureEndPosition;
                    iLeftEnclosureEndPosition = tmp;

                    bStartSidebarExpandTransition = false;

                    iRightSidebarCurrentheight = iRightSidebarStartheight;
                    iLeftEnclosureCurrentPosition = iLeftEnclosureStartPosition;
                }
            }


        }

        /// <summary>
        /// Draws the Base Scene
        /// </summary>
        private void DrawBase2DScene()
        {
            //Currently using absolute values
            Rectangle rectFullscreen = new Rectangle(0, 0, sceneEngine.GraphicsDevice.Viewport.Width, sceneEngine.GraphicsDevice.Viewport.Height);
            //Rectangle rectHeader = new Rectangle((int)((float)10 * Game22Yards.scaleFactor.widthScale), (int)((float)5 * Game22Yards.scaleFactor.htScale), sceneEngine.GraphicsDevice.Viewport.Width + (int)((float)200 * Game22Yards.scaleFactor.widthScale), (int)((float)105 * Game22Yards.scaleFactor.htScale));
            Rectangle rectLeftSidebar = new Rectangle((int)((float)15 * Game22Yards.scaleFactor.widthScale), (int)((float)93 * Game22Yards.scaleFactor.htScale), (int)((float)263 * Game22Yards.scaleFactor.widthScale), (int)((float)575 * Game22Yards.scaleFactor.htScale));
            Rectangle rectRightSidebar = new Rectangle((int)((float)280 * Game22Yards.scaleFactor.widthScale), (int)((float)90 * Game22Yards.scaleFactor.htScale), (int)((float)1300 * Game22Yards.scaleFactor.widthScale), iRightSidebarCurrentheight);
            Rectangle rectInfobar = new Rectangle((int)((float)285 * Game22Yards.scaleFactor.widthScale), (int)((float)678 * Game22Yards.scaleFactor.htScale), iInfobarCurrentwidth, (int)((float)95 * Game22Yards.scaleFactor.htScale));
            Rectangle rectLeftEnclosure = new Rectangle((int)((float)282 * Game22Yards.scaleFactor.widthScale), iLeftEnclosureCurrentPosition, (int)((float)15 * Game22Yards.scaleFactor.widthScale), (int)((float)96 * Game22Yards.scaleFactor.htScale));
            Rectangle rectScorebarBase = new Rectangle((int)((float)18 * Game22Yards.scaleFactor.widthScale), (int)((float)678 * Game22Yards.scaleFactor.htScale), (int)((float)258 * Game22Yards.scaleFactor.widthScale), (int)((float)76 * Game22Yards.scaleFactor.htScale));
            Rectangle rectScorebarTexture = new Rectangle((int)((float)18 * Game22Yards.scaleFactor.widthScale), (int)((float)678 * Game22Yards.scaleFactor.htScale), (int)((float)258 * Game22Yards.scaleFactor.widthScale), (int)((float)76 * Game22Yards.scaleFactor.htScale));
            Rectangle rectScorebarEnclosure = new Rectangle((int)((float)15 * Game22Yards.scaleFactor.widthScale), (int)((float)666 * Game22Yards.scaleFactor.htScale), (int)((float)265 * Game22Yards.scaleFactor.widthScale), (int)((float)100 * Game22Yards.scaleFactor.htScale));

            sceneEngine.SpriteBatch.Begin();

            sceneEngine.SpriteBatch.Draw(backgroundTexture, rectFullscreen, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));
            //sceneEngine.SpriteBatch.Draw(headerTexture, rectHeader, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));
            sceneEngine.SpriteBatch.Draw(leftSidebarTexture, rectLeftSidebar, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));
            //sceneEngine.SpriteBatch.Draw(rightSidebarTexture, rectRightSidebar, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));
            sceneEngine.SpriteBatch.Draw(leftEnclosureTexture, rectLeftEnclosure, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));

            //Scorebar
            sceneEngine.SpriteBatch.Draw(scorebarBaseTexture, rectScorebarBase, Color.DodgerBlue);
            sceneEngine.SpriteBatch.Draw(scorebarTexturedTexture, rectScorebarTexture, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));
            sceneEngine.SpriteBatch.Draw(scorebarEnclosureTexture, rectScorebarEnclosure, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));

            //Infobar
            sceneEngine.SpriteBatch.Draw(infobarTexture, rectInfobar, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));

            //Print Header
            Vector2 titlePosition = new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2, ((float)60 * Game22Yards.scaleFactor.htScale));
            Vector2 titleOrigin = sceneEngine.TxtNFont.spFontPescadero.MeasureString(Game22Yards.matchPlayEngine.match.MatchTitle) / 2;
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.matchPlayEngine.match.MatchTitle, titlePosition, Color.White, 0f, titleOrigin, 1.2f, SpriteEffects.None, 0f);

            //Print on Scorebar
            if (Game22Yards.matchPlayEngine.match.Team1.CurrentTeamBatting)
            {
                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.matchPlayEngine.match.Team1.TeamShortName + " - " + Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScoreValue(false), new Vector2(((float)42 * Game22Yards.scaleFactor.widthScale), ((float)687 * Game22Yards.scaleFactor.htScale)), Color.Black);
                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.matchPlayEngine.match.Team1.TeamShortName + " - " + Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScoreValue(false), new Vector2(((float)40 * Game22Yards.scaleFactor.widthScale), ((float)685 * Game22Yards.scaleFactor.htScale)), Color.White);

            }
            else if (Game22Yards.matchPlayEngine.match.Team2.CurrentTeamBatting)
            {
                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.matchPlayEngine.match.Team2.TeamShortName + " - " + Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScoreValue(false), new Vector2(((float)42 * Game22Yards.scaleFactor.widthScale), ((float)687 * Game22Yards.scaleFactor.htScale)), Color.Black);
                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.matchPlayEngine.match.Team2.TeamShortName + " - " + Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScoreValue(false), new Vector2(((float)40 * Game22Yards.scaleFactor.widthScale), ((float)685 * Game22Yards.scaleFactor.htScale)), Color.White);

            }
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.match.matchScore.GetInningsInProgress().ToString() + " INN", new Vector2(((float)187 * Game22Yards.scaleFactor.widthScale), ((float)687 * Game22Yards.scaleFactor.htScale)), Color.Black);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.match.matchScore.GetInningsInProgress().ToString() + " INN", new Vector2(((float)185 * Game22Yards.scaleFactor.widthScale), ((float)685 * Game22Yards.scaleFactor.htScale)), Color.White);


            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.match.matchScore.CurrentInningsScore().Oversbowled.GetOversNBallsBowled() + " Overs", new Vector2(((float)42 * Game22Yards.scaleFactor.widthScale), ((float)717 * Game22Yards.scaleFactor.htScale)), Color.Black);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, Game22Yards.match.matchScore.CurrentInningsScore().Oversbowled.GetOversNBallsBowled() + " Overs", new Vector2(((float)40 * Game22Yards.scaleFactor.widthScale), ((float)715 * Game22Yards.scaleFactor.htScale)), Color.White);


            //Infobar
            if (iInfoBarStartwidth > iInfobarEndWidth && bInfobarExpanded)
            {
                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, sInfoBarMessage, new Vector2(((float)325 * Game22Yards.scaleFactor.widthScale), ((float)700 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 1);
                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPescadero, sInfoBarMessage, new Vector2(((float)327 * Game22Yards.scaleFactor.widthScale), ((float)702 * Game22Yards.scaleFactor.htScale)), Color.Black, 0f, Vector2.Zero, 1f, SpriteEffects.None, 2);
            }

            sceneEngine.SpriteBatch.End();

        }

        /// <summary>
        /// Draws the default view port items.
        /// </summary>
        private void DrawDefaultViewPortItems()
        {
            //Draw default Photoframes
            photoFrames[0].Draw(staticCamera, Matrix.Identity); //Batsman1
            photoFrames[1].Draw(staticCamera, Matrix.Identity); //Batsman2
            photoFrames[2].Draw(staticCamera, Matrix.Identity); //Bowler1
            photoFrames[3].Draw(staticCamera, Matrix.Identity); //Bowler2

            Team1Logo.Technique = "NormalMappingNoShadow";
            Team2Logo.Technique = "NormalMappingNoShadow";
            Team1Logo.Draw(staticCamera, Matrix.Identity);
            Team2Logo.Draw(staticCamera, Matrix.Identity);
        }

        private void DisplayRemainingPhotoFrames()
        {

            if (DisplayRemainingBatsMan)
            {
                DisplayRemainingBatsManPhotoframes();
            }

            if (DisplayRemainingBowler)
            {
                DispayRemainingBowlerPhotoframes();
            }
        }

        /// <summary>
        /// Draws the summary on screen.
        /// </summary>
        private void Draw2DSceneSummary(ref Texture2D tex)
        {
            Score inningsScore = Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore();
            string score1 = string.Empty;
            string score2 = string.Empty;

            if (Game22Yards.matchPlayEngine.match.Team1.FirstBatting)
            {

                for (int i = 1; i < Game22Yards.matchPlayEngine.match.matchScore.NumInnings; i = i + 2)
                {
                    if (i > Game22Yards.matchPlayEngine.match.matchScore.GetInningsInProgress())
                    {
                        break;
                    }
                    if (i > 1)
                    {
                        score1 += " & " + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                        continue;
                    }
                    score1 = Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).TeamName + "-" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                }

                for (int i = 2; i < Game22Yards.matchPlayEngine.match.matchScore.NumInnings; i = i + 2)
                {
                    if (i > Game22Yards.matchPlayEngine.match.matchScore.GetInningsInProgress())
                    {
                        break;
                    }
                    if (i > 1)
                    {
                        score2 += " & " + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                        continue;
                    }
                    score2 = Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).TeamName + "-" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                }

            }
            else if (!Game22Yards.matchPlayEngine.match.Team1.FirstBatting)
            {

                for (int i = 1; i < Game22Yards.matchPlayEngine.match.matchScore.NumInnings; i = i + 2)
                {
                    if (i > Game22Yards.matchPlayEngine.match.matchScore.GetInningsInProgress())
                    {
                        break;
                    }
                    if (i > 1)
                    {
                        score1 += " & " + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                        continue;
                    }
                    score1 = Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).TeamName + "-" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                }
                for (int i = 2; i < Game22Yards.matchPlayEngine.match.matchScore.NumInnings; i = i + 2)
                {
                    if (i > Game22Yards.matchPlayEngine.match.matchScore.GetInningsInProgress())
                    {
                        break;
                    }
                    if (i > 1)
                    {
                        score2 += " & " + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                        continue;
                    }
                    score2 = Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).TeamName + "-" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScoreValue(i, false) + "  (" + Game22Yards.matchPlayEngine.match.matchScore.NthInningsScore(i).Oversbowled.GetOversNBallsBowled() + ")";
                }
            }

            string runsScored1 = BatsmenOnCrease[0].Name + " - " + inningsScore.RunsScoredByBatsmanCurrentInnings(BatsmenOnCrease[0].PlayerID).ToString() + " (" + inningsScore.BallsFacedByBatsmanCurrentInnings(BatsmenOnCrease[0].PlayerID).ToString() + ")";
            string runsScored2 = BatsmenOnCrease[1].Name + " - " + inningsScore.RunsScoredByBatsmanCurrentInnings(BatsmenOnCrease[1].PlayerID).ToString() + " (" + inningsScore.BallsFacedByBatsmanCurrentInnings(BatsmenOnCrease[1].PlayerID).ToString() + ")";

            //RenderTarget2D rndTargetSummary = new RenderTarget2D(sceneEngine.GraphicsDevice, (int)((float)512 * Game22Yards.scaleFactor.widthScale), (int)((float)512 * Game22Yards.scaleFactor.widthScale), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 4, RenderTargetUsage.PreserveContents);
            sceneEngine.GraphicsDevice.Clear(Color.SlateBlue);
            
            sceneEngine.GraphicsDevice.SetRenderTarget(rndTargetSummary);
            string msg = "Toss: " + Game22Yards.matchPlayEngine.MessageStore.Messages.Find(m => m.Category == "Toss").Msg;
            sceneEngine.SpriteBatch.Begin();

            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontSegoeKeycaps, Game22Yards.matchPlayEngine.match.MatchTitle, new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2 - sceneEngine.TxtNFont.spFontSegoeKeycaps.MeasureString(Game22Yards.matchPlayEngine.match.MatchTitle).X * (7f / 20f), ((float)250 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, new Vector2(0, 0), 0.7f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontWascoSansBoldItalic, msg, new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2 - sceneEngine.TxtNFont.spFontWascoSansBoldItalic.MeasureString(msg).X * (8f / 20f), ((float)275 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, new Vector2(0, 0), 0.8f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontAdventureSubtitles, score1, new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2 - sceneEngine.TxtNFont.spFontAdventureSubtitles.MeasureString(score1).X * (8f / 20f), ((float)310 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, new Vector2(0, 0), 0.8f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontAdventureSubtitles, score2, new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2 - sceneEngine.TxtNFont.spFontAdventureSubtitles.MeasureString(score2).X * (8f / 20f), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, new Vector2(0, 0), 0.8f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontQuartzMS, runsScored1, new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2 - sceneEngine.TxtNFont.spFontQuartzMS.MeasureString(runsScored1).X * (8f / 20f), ((float)390 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, new Vector2(0, 0), 0.8f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontQuartzMS, runsScored2, new Vector2(sceneEngine.GraphicsDevice.Viewport.Width / 2 - sceneEngine.TxtNFont.spFontQuartzMS.MeasureString(runsScored2).X * (8f / 20f), ((float)410 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, new Vector2(0, 0), 0.8f, SpriteEffects.None, 0);


            sceneEngine.SpriteBatch.End();

            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            tex = rndTargetSummary;

        }

        /// <summary>
        /// Draws the score card view.
        /// </summary>
        private void Draw2DSceneScoreCardView(ref Texture2D tex)
        {
            Score inningsscore = (Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore());
            sceneEngine.GraphicsDevice.Clear(Color.SlateBlue);
            
            sceneEngine.SpriteBatch.Begin();
            float fScale = 0.7f;

            //RenderTarget2D rndTargetScoreCard = new RenderTarget2D(sceneEngine.GraphicsDevice, (int)((float)1366 * Game22Yards.scaleFactor.widthScale), (int)((float)768 * Game22Yards.scaleFactor.widthScale), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 4, RenderTargetUsage.PreserveContents);
            sceneEngine.GraphicsDevice.SetRenderTarget(rndTargetScoreCard);
            if (Game22Yards.matchPlayEngine.match.Team1.IsUserSelected)
            {
                if (Game22Yards.matchPlayEngine.match.Team1.CurrentTeamBatting)
                {
                    //Print Batting Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Batsman Name", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Balls", new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Dots", new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "S/R", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    //Print Each Player
                    int Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team1.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (cpl.IsBatting)
                            {
                                if (!cpl.IsOnStrike)
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                else
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }
                            else if (!cpl.IsBatting && !cpl.IsOut)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else if (!cpl.IsBatting && cpl.IsOut)
                            {
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }

                    }

                    //Print Bowling Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Bowler Name", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Overs", new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Extras", new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Econ", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    //Print Each Player
                    Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team2.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (!cpl.IsBowlingCurrently)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.FoursConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.TotalExtrasBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID) > 0) ? (((float)inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID) / (float)inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID)) * (float)6).ToString() : "0.0", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }

                    }


                }
                else
                {
                    //Print Bowling Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Bowler Name", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Overs", new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Extras", new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Econ", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    //Print Each Player
                    int Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team1.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (!cpl.IsBowlingCurrently)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.FoursConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.TotalExtrasBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID) > 0) ? (((float)inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID) / (float)inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID)) * (float)6).ToString() : "0.0", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }
                    }

                    //Print Batting Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Batsman Name", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Balls", new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Dots", new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "S/R", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team2.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (cpl.IsBatting)
                            {
                                if (!cpl.IsOnStrike)
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                else
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }
                            else if (!cpl.IsBatting && !cpl.IsOut)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else if (!cpl.IsBatting && cpl.IsOut)
                            {
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }

                    }


                }
            }
            else if (Game22Yards.matchPlayEngine.match.Team2.IsUserSelected)
            {
                if (Game22Yards.matchPlayEngine.match.Team2.CurrentTeamBatting)
                {
                    //Print Batting Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Batsman Name", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Balls", new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Dots", new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "S/R", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    int Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team2.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (cpl.IsBatting)
                            {
                                if (!cpl.IsOnStrike)
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                else
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }
                            else if (!cpl.IsBatting && !cpl.IsOut)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else if (!cpl.IsBatting && cpl.IsOut)
                            {
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }

                    }

                    //Print Bowling Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Bowler Name", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Overs", new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Extras", new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Econ", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), ((float)340 * Game22Yards.scaleFactor.htScale)), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    //Print Each Player
                    Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team1.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (!cpl.IsBowlingCurrently)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.FoursConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.TotalExtrasBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID) > 0) ? (((float)inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID) / (float)inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID)) * (float)6).ToString() : "0.0", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }
                    }
                }
                else
                {
                    //Print Bowling Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Bowler Name", new Vector2((float)20 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Overs", new Vector2((float)180 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2((float)240 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2((float)300 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2((float)340 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Extras", new Vector2((float)380 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Econ", new Vector2((float)440 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    //Print Each Player
                    int Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team2.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (!cpl.IsBowlingCurrently)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)20 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)180 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)240 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.FoursConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)300 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesConceededByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)340 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.TotalExtrasBowledByBowlerCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)380 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID) > 0) ? (((float)inningsscore.RunsConceededByBowlerCurrentInnings(cpl.PlayerID) / (float)inningsscore.LegalBallsBowledByBowlerCurrentInnings(cpl.PlayerID)) * (float)6).ToString() : "0.0", new Vector2(((float)440 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }
                    }

                    //Print Batting Header
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Batsman Name", new Vector2((float)560 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Runs", new Vector2((float)720 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Balls", new Vector2((float)780 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "4's", new Vector2((float)840 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "6's", new Vector2((float)880 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "Dots", new Vector2((float)920 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, "S/R", new Vector2((float)1000 * Game22Yards.scaleFactor.widthScale, (float)340 * Game22Yards.scaleFactor.htScale), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                    Y = (int)((float)360 * Game22Yards.scaleFactor.htScale);
                    foreach (cPlayer cpl in Game22Yards.matchPlayEngine.match.Team1.players)
                    {
                        if (!cpl.Is12thMan)
                        {
                            if (cpl.IsBatting)
                            {
                                if (!cpl.IsOnStrike)
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                else
                                    sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name + "*", new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)780 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), Y), Color.Yellow, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }
                            else if (!cpl.IsBatting && !cpl.IsOut)
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                            else if (!cpl.IsBatting && cpl.IsOut)
                            {
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, cpl.Name, new Vector2(((float)560 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)720 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.BoundariesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)840 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.SixesScoredByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)880 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, inningsscore.DotsByBatsmanCurrentInnings(cpl.PlayerID).ToString(), new Vector2(((float)920 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);
                                sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontPericles, (inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID) > 0) ? ((float)inningsscore.RunsScoredByBatsmanCurrentInnings(cpl.PlayerID) / (float)inningsscore.BallsFacedByBatsmanCurrentInnings(cpl.PlayerID)).ToString() : "0.0", new Vector2(((float)1000 * Game22Yards.scaleFactor.widthScale), Y), Color.White, 0f, Vector2.Zero, fScale, SpriteEffects.None, 0);

                            }

                            Y += (int)((float)20 * Game22Yards.scaleFactor.htScale);
                        }

                    }
                }
            }

            sceneEngine.SpriteBatch.End();

            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            tex = rndTargetScoreCard;

        }

        /// <summary>
        /// Renders the batsman score on score texture.
        /// </summary>
        /// <param name="tex">The texture.</param>
        /// <param name="PF">The photoframe.</param>
        /// <param name="_rnd">The RenderTarget.</param>
        private void RenderBatsManScoreOnScoreTexture(ref Texture2D tex, PhotoFrameModel PF, ref RenderTarget2D _rnd)
        {
            //RenderTarget2D rndTargetBatsman = new RenderTarget2D(sceneEngine.GraphicsDevice, (int)((float)512 * Game22Yards.scaleFactor.widthScale), (int)((float)512 * Game22Yards.scaleFactor.widthScale), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 4, RenderTargetUsage.PreserveContents);
            sceneEngine.GraphicsDevice.SetRenderTarget(_rnd);
            _rnd.GraphicsDevice.Clear(Color.SlateBlue);
            string Msg = Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore().RunsScoredByBatsmanCurrentInnings(PF.PlayerID.PlayerID).ToString();
            if (PF.PlayerID.IsOnStrike)
                Msg = Msg + "*";
            Msg += " (" + Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore().BallsFacedByBatsmanCurrentInnings(PF.PlayerID.PlayerID).ToString() + ")";

            Color clr = Color.Wheat;
            if (PF.PlayerID.IsOnStrike)
                clr = Color.YellowGreen;
            else if (!PF.PlayerID.IsOnStrike && PF.PlayerID.IsBatting)
                clr = Color.DarkSeaGreen;
            else if (!PF.PlayerID.IsBatting && !PF.PlayerID.IsOut)
            {
                clr = Color.Yellow;
                Msg = "ToBat";
            }
            else if (PF.PlayerID.IsOut)
                clr = Color.Red;


            //Game22Yards.pb1.spriteBatch = sceneEngine.SpriteBatch;
            sceneEngine.SpriteBatch.Begin();
            sceneEngine.SpriteBatch.Draw(tex, new Vector2(0, 0), clr);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontWascoSansBold,
                Msg,
                new Vector2(256 - (sceneEngine.TxtNFont.spFontWascoSansBold.MeasureString(Msg).X * 4) / 2 + 20f,
                (int)((float)280 * Game22Yards.scaleFactor.widthScale)),
                Color.Black, 0f, Vector2.Zero,
                4f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.End();
            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            tex = _rnd;

        }

        /// <summary>
        /// Renders the batsman info on info texture.
        /// </summary>
        /// <param name="tex">The texture.</param>
        /// <param name="PF">The PhotoFrame.</param>
        /// <param name="_rnd">The RenderTarget.</param>
        private void RenderBatsmanInfoOnInfoTexture(ref Texture2D tex, PhotoFrameModel PF, ref RenderTarget2D _rnd)
        {
            string[] pbMsgs = new string[2] { "Confidence", "Settled" };
            Vector2[] pbPos = new Vector2[2] { new Vector2((float)45 * Game22Yards.scaleFactor.widthScale, (float)380 * Game22Yards.scaleFactor.htScale), new Vector2((float)45 * Game22Yards.scaleFactor.widthScale, (float)440 * Game22Yards.scaleFactor.htScale) };
            int[] pbValues = new int[2] { PF.PlayerID.CurrentBattingConfidence, PF.PlayerID.BatsmanSettledOnPitch };
            //RenderTarget2D rndTargetBowler = new RenderTarget2D(sceneEngine.GraphicsDevice, (int)((float)512 * Game22Yards.scaleFactor.widthScale), (int)((float)512 * Game22Yards.scaleFactor.widthScale), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 4, RenderTargetUsage.PreserveContents);
            sceneEngine.GraphicsDevice.SetRenderTarget(_rnd);
            _rnd.GraphicsDevice.Clear(Color.SlateBlue);
            Game22Yards.pb1.Position = pbPos[0];
            Game22Yards.pb1.Value = pbValues[0];
            Game22Yards.pb1.HelperText = pbMsgs[0];
            Game22Yards.pb1.ShowText = true;

            string Name = PF.PlayerID.Name;
            if (PF.PlayerID.IsCaptain)
                Name += " (C)";
            if (PF.PlayerID.IsWicketKeeper)
                Name += "(WK)";
            if (PF.PlayerID.IsRightHandedBatsman)
                Name += "-RHB";
            else
                Name += "-LHB";

            Game22Yards.pb1.spriteBatch = sceneEngine.SpriteBatch;
            sceneEngine.SpriteBatch.Begin();
            sceneEngine.SpriteBatch.Draw(tex, new Vector2(0, 0), Color.White);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontAdventureSubtitles, Name, new Vector2((int)((float)45 * Game22Yards.scaleFactor.widthScale), (int)((float)130 * Game22Yards.scaleFactor.widthScale)), Color.Black, 0f, Vector2.Zero, 2.5f, SpriteEffects.None, 0);
            //sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontAcens,PF.PlayerID.n );
            Game22Yards.pb1.Draw(222, 32, sceneEngine.TxtNFont.spFontAndyBold);
            Game22Yards.pb1.Position = pbPos[1];
            Game22Yards.pb1.Value = pbValues[1];
            Game22Yards.pb1.HelperText = pbMsgs[1];
            Game22Yards.pb1.ShowText = true;
            Game22Yards.pb1.Draw(222, 32, sceneEngine.TxtNFont.spFontAndyBold);

            sceneEngine.SpriteBatch.End();
            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            tex = _rnd;

        }

        /// <summary>
        /// Sets the texture for player remaining batsmen.
        /// </summary>
        void SetTextureForPlayerRemainingBatsmen()
        {
            for (int i = 4, j = 0; i < 13 && j < 12; j++)
            {
                if (Game22Yards.matchPlayEngine.match.Team1.CurrentTeamBatting)
                {
                    if (!Game22Yards.matchPlayEngine.match.Team1.players[j].Is12thMan && !Game22Yards.matchPlayEngine.match.Team1.players[j].IsBatting)
                    {
                        photoFrames[i].PlayerID = Game22Yards.matchPlayEngine.match.Team1.players[j];
                        i++;
                    }
                }
                else if (Game22Yards.matchPlayEngine.match.Team2.CurrentTeamBatting)
                {
                    if (!Game22Yards.matchPlayEngine.match.Team2.players[j].Is12thMan && !Game22Yards.matchPlayEngine.match.Team2.players[j].IsBatting)
                    {
                        photoFrames[i].PlayerID = Game22Yards.matchPlayEngine.match.Team2.players[j];
                        i++;
                    }
                }
            }

            LightingMaterial matPFBatsman = new LightingMaterial();
            matPFBatsman.LightDirection = new Vector3(-0.4f, 1f, -0.5f);
            matPFBatsman.SpecularPower = 0;
            matPFBatsman.Shininess = 0;
            matPFBatsman.AmbientIntensity = 0.3f;

            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer3Info, photoFrames[4], ref rndTargetBatsman3Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer4Info, photoFrames[5], ref rndTargetBatsman4Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer5Info, photoFrames[6], ref rndTargetBatsman5Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer6Info, photoFrames[7], ref rndTargetBatsman6Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer7Info, photoFrames[8], ref rndTargetBatsman7Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer8Info, photoFrames[9], ref rndTargetBatsman8Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer9Info, photoFrames[10], ref rndTargetBatsman9Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer10Info, photoFrames[11], ref rndTargetBatsman10Info);
            RenderBatsmanInfoOnInfoTexture(ref texPFBattingTeamPlayer11Info, photoFrames[12], ref rndTargetBatsman11Info);
            photoFrames[4].SetModelMeshEffect(simpleEff, true, matPFBatsman,"playerinfomesh", texPFBattingTeamPlayer3Info);
            photoFrames[5].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer4Info);
            photoFrames[6].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer5Info);
            photoFrames[7].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer6Info);
            photoFrames[8].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer7Info);
            photoFrames[9].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer8Info);
            photoFrames[10].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer9Info);
            photoFrames[11].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer10Info);
            photoFrames[12].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerinfomesh", texPFBattingTeamPlayer11Info);

            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer3Score, photoFrames[4], ref rndTargetBatsman3Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer4Score, photoFrames[5], ref rndTargetBatsman4Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer5Score, photoFrames[6], ref rndTargetBatsman5Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer6Score, photoFrames[7], ref rndTargetBatsman6Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer7Score, photoFrames[8], ref rndTargetBatsman7Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer8Score, photoFrames[9], ref rndTargetBatsman8Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer9Score, photoFrames[10], ref rndTargetBatsman9Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer10Score, photoFrames[11], ref rndTargetBatsman10Score);
            RenderBatsManScoreOnScoreTexture(ref texPFBattingTeamPlayer11Score, photoFrames[12], ref rndTargetBatsman11Score);

            photoFrames[4].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer3Score);
            photoFrames[5].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer4Score);
            photoFrames[6].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer5Score);
            photoFrames[7].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer6Score);
            photoFrames[8].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer7Score);
            photoFrames[9].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer8Score);
            photoFrames[10].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer9Score);
            photoFrames[11].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer10Score);
            photoFrames[12].SetModelMeshEffect(simpleEff, true, matPFBatsman, "playerscoremesh", texPFBattingTeamPlayer11Score);

            RendereredGroupToBatsmen = true;//This has to be false from the code which makes changes to active bowler or active batsmen when bowler active bowlers or active batsmen change
        }

        /// <summary>
        /// Renders the bowler score on score texture.
        /// </summary>
        /// <param name="tex">The tex.</param>
        /// <param name="PF">The PhotoFrame.</param>
        /// <param name="_rnd">The RenderTarget.</param>
        private void RenderBowlerScoreOnScoreTexture(ref Texture2D tex, PhotoFrameModel PF, ref RenderTarget2D _rnd)
        {
            //RenderTarget2D rndTargetBowlerScore = new RenderTarget2D(sceneEngine.GraphicsDevice, (int)((float)512 * Game22Yards.scaleFactor.widthScale), (int)((float)512 * Game22Yards.scaleFactor.widthScale), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 4, RenderTargetUsage.PreserveContents);
            sceneEngine.GraphicsDevice.SetRenderTarget(_rnd);
            _rnd.GraphicsDevice.Clear(Color.SlateBlue);
            string Msg = (Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore().LegalBallsBowledByBowlerCurrentInnings(PF.PlayerID.PlayerID)/6).ToString() + "." + (Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore().LegalBallsBowledByBowlerCurrentInnings(PF.PlayerID.PlayerID)%6).ToString();
            if (PF.PlayerID.IsOnStrike)
                Msg = Msg + "*";
            Msg += "/" + Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore().RunsConceededByBowlerCurrentInnings(PF.PlayerID.PlayerID).ToString();

            Color clr = Color.Wheat;
            if (PF.PlayerID.IsBowlingCurrently)
                clr = Color.YellowGreen;
            else if (PF.PlayerID.IsSetToBowlNext)
                clr = Color.DarkSeaGreen;
            else if (!PF.PlayerID.IsBowlingCurrently && !PF.PlayerID.IsSetToBowlNext)
            {
                clr = Color.Yellow;
                Msg = "ToBowl";
            }
            else if (Game22Yards.matchPlayEngine.match.matchScore.CurrentInningsScore().LegalBallsBowledByBowlerCurrentInnings(PF.PlayerID.PlayerID)/6 ==Game22Yards.matchPlayEngine.match.MatchRule.MaxOversPerBowler)
                clr = Color.Red;


            //Game22Yards.pb1.spriteBatch = sceneEngine.SpriteBatch;
            sceneEngine.SpriteBatch.Begin();
            sceneEngine.SpriteBatch.Draw(tex, new Vector2(0, 0), clr);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontWascoSansBold,
                Msg,
                new Vector2(256 - (sceneEngine.TxtNFont.spFontWascoSansBold.MeasureString(Msg).X * 4) / 2 + 20f,
                (int)((float)280 * Game22Yards.scaleFactor.widthScale)),
                Color.Black, 0f, Vector2.Zero,
                4f, SpriteEffects.None, 0);
            sceneEngine.SpriteBatch.End();
            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            tex = _rnd;

        }

        /// <summary>
        /// Renders the bowler info on info texture.
        /// </summary>
        /// <param name="tex">The texture.</param>
        /// <param name="PF">The PhotoFrame.</param>
        /// <param name="_rnd">The RenderTarget.</param>
        private void RenderBowlerInfoOnInfoTexture(ref Texture2D tex, PhotoFrameModel PF, ref RenderTarget2D _rnd)
        {
            string[] pbMsgs = new string[2] { "Confidence", "Stamina" };
            Vector2[] pbPos = new Vector2[2] { new Vector2((float)45 * Game22Yards.scaleFactor.widthScale, (float)380 * Game22Yards.scaleFactor.htScale), new Vector2((float)45 * Game22Yards.scaleFactor.widthScale, (float)440 * Game22Yards.scaleFactor.htScale) };
            int[] pbValues = new int[2] { PF.PlayerID.CurrentBowlingConfidence, PF.PlayerID.Stamina };
            //RenderTarget2D rndTargetBowlerInfo = new RenderTarget2D(sceneEngine.GraphicsDevice, (int)((float)512 * Game22Yards.scaleFactor.widthScale), (int)((float)512 * Game22Yards.scaleFactor.widthScale), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8, 4, RenderTargetUsage.PreserveContents);
            sceneEngine.GraphicsDevice.SetRenderTarget(_rnd);
            _rnd.GraphicsDevice.Clear(Color.SlateBlue);
            
            Game22Yards.pb1.Position = pbPos[0];
            Game22Yards.pb1.Value = pbValues[0];
            Game22Yards.pb1.HelperText = pbMsgs[0];
            Game22Yards.pb1.ShowText = true;

            string Name = PF.PlayerID.Name;
            if (PF.PlayerID.IsCaptain)
                Name += " (C)";
            if (PF.PlayerID.IsWicketKeeper)
                Name += "(WK)";
            if (PF.PlayerID.IsRightHandedBowler)
                Name += "-RHBo";
            else
                Name += "-LHBo";

            Game22Yards.pb1.spriteBatch = sceneEngine.SpriteBatch;
            sceneEngine.SpriteBatch.Begin();
            sceneEngine.SpriteBatch.Draw(tex, new Vector2(0, 0), Color.White);
            sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontAdventureSubtitles, Name, new Vector2((int)((float)45 * Game22Yards.scaleFactor.widthScale), (int)((float)130 * Game22Yards.scaleFactor.widthScale)), Color.Black, 0f, Vector2.Zero, 2.5f, SpriteEffects.None, 0);
            //sceneEngine.SpriteBatch.DrawString(sceneEngine.TxtNFont.spFontAcens,PF.PlayerID.n );
            Game22Yards.pb1.Draw(222, 32, sceneEngine.TxtNFont.spFontAndyBold);
            Game22Yards.pb1.Position = pbPos[1];
            Game22Yards.pb1.Value = pbValues[1];
            Game22Yards.pb1.HelperText = pbMsgs[1];
            Game22Yards.pb1.ShowText = true;
            Game22Yards.pb1.Draw((int)((float)222 * Game22Yards.scaleFactor.widthScale), (int)((float)32 * Game22Yards.scaleFactor.htScale), sceneEngine.TxtNFont.spFontAndyBold);

            sceneEngine.SpriteBatch.End();
            sceneEngine.GraphicsDevice.SetRenderTarget(null);
            tex = _rnd;

        }

        /// <summary>
        /// Sets the texture for player remaining bowlers.
        /// </summary>
        void SetTextureForPlayerRemainingBowlers()
        {
            for (int i = 13, j = 0; i < 22 && j < 12; j++)
            {
                if (!Game22Yards.matchPlayEngine.match.Team1.CurrentTeamBatting)
                {
                    if (!Game22Yards.matchPlayEngine.match.Team1.players[j].Is12thMan && !Game22Yards.matchPlayEngine.match.Team1.players[j].IsBowlingCurrently && !Game22Yards.matchPlayEngine.match.Team1.players[j].IsSetToBowlNext)
                    {
                        photoFrames[i].PlayerID = Game22Yards.matchPlayEngine.match.Team1.players[j];
                        i++;
                    }
                }
                else if (!Game22Yards.matchPlayEngine.match.Team2.CurrentTeamBatting)
                {
                    if (!Game22Yards.matchPlayEngine.match.Team2.players[j].Is12thMan && !Game22Yards.matchPlayEngine.match.Team2.players[j].IsBowlingCurrently && !Game22Yards.matchPlayEngine.match.Team2.players[j].IsSetToBowlNext)
                    {
                        photoFrames[i].PlayerID = Game22Yards.matchPlayEngine.match.Team2.players[j];
                        i++;
                    }
                }
            }

            LightingMaterial matPFBowler = new LightingMaterial();
            matPFBowler.LightDirection = new Vector3(-0.4f, 1f, -0.5f);
            matPFBowler.SpecularPower = 0;
            matPFBowler.Shininess = 0;
            matPFBowler.AmbientIntensity = 0.3f;

            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer3Info, photoFrames[13], ref rndTargetBowler3Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer4Info, photoFrames[14], ref rndTargetBowler4Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer5Info, photoFrames[15], ref rndTargetBowler5Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer6Info, photoFrames[16], ref rndTargetBowler6Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer7Info, photoFrames[17], ref rndTargetBowler7Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer8Info, photoFrames[18], ref rndTargetBowler8Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer9Info, photoFrames[19], ref rndTargetBowler9Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer10Info, photoFrames[20], ref rndTargetBowler10Info);
            RenderBowlerInfoOnInfoTexture(ref texPFBowlingTeamPlayer11Info, photoFrames[21], ref rndTargetBowler11Info);
            photoFrames[13].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer3Info);
            photoFrames[14].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer4Info);
            photoFrames[15].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer5Info);
            photoFrames[16].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer6Info);
            photoFrames[17].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer7Info);
            photoFrames[18].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer8Info);
            photoFrames[19].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer9Info);
            photoFrames[20].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer10Info);
            photoFrames[21].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerinfomesh", texPFBowlingTeamPlayer11Info);

            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer3Score, photoFrames[13], ref rndTargetBowler3Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer4Score, photoFrames[14], ref rndTargetBowler4Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer5Score, photoFrames[15], ref rndTargetBowler5Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer6Score, photoFrames[16], ref rndTargetBowler6Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer7Score, photoFrames[17], ref rndTargetBowler7Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer8Score, photoFrames[18], ref rndTargetBowler8Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer9Score, photoFrames[19], ref rndTargetBowler9Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer10Score, photoFrames[20], ref rndTargetBowler10Score);
            RenderBowlerScoreOnScoreTexture(ref texPFBowlingTeamPlayer11Score, photoFrames[21], ref rndTargetBowler11Score);

            photoFrames[13].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer3Score);
            photoFrames[14].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer4Score);
            photoFrames[15].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer5Score);
            photoFrames[16].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer6Score);
            photoFrames[17].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer7Score);
            photoFrames[18].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer8Score);
            photoFrames[19].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer9Score);
            photoFrames[20].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer10Score);
            photoFrames[21].SetModelMeshEffect(simpleEff, true, matPFBowler, "playerscoremesh", texPFBowlingTeamPlayer11Score);

            RendereredGroupToBowlers = true;//This has to be false from the code which makes changes to active bowler or active batsmen when bowler active bowlers or active batsmen change
        }

        /// <summary>
        /// Displays the remaining bats man photoframes.
        /// </summary>
        void DisplayRemainingBatsManPhotoframes()
        {
            photoFrames[4].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[5].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[6].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[7].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[8].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[9].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[10].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[11].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[12].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);

            photoFrames[4].Position = new Vector3(FirstColCurrentXPos, (float)10f * Game22Yards.scaleFactor.widthScale, (float)39f * Game22Yards.scaleFactor.htScale);
            photoFrames[5].Position = new Vector3(SecondColCurrentXPos, (float)10f * Game22Yards.scaleFactor.widthScale, (float)39f * Game22Yards.scaleFactor.htScale);
            photoFrames[6].Position = new Vector3(ThirdColCurrentXPos, (float)10f * Game22Yards.scaleFactor.widthScale, (float)39f * Game22Yards.scaleFactor.htScale);
            photoFrames[7].Position = new Vector3(FirstColCurrentXPos, (float)0f * Game22Yards.scaleFactor.widthScale, (float)43f * Game22Yards.scaleFactor.htScale);
            photoFrames[8].Position = new Vector3(SecondColCurrentXPos, (float)0f * Game22Yards.scaleFactor.widthScale, (float)43f * Game22Yards.scaleFactor.htScale);
            photoFrames[9].Position = new Vector3(ThirdColCurrentXPos, (float)0f * Game22Yards.scaleFactor.widthScale, (float)43f * Game22Yards.scaleFactor.htScale);
            photoFrames[10].Position = new Vector3(FirstColCurrentXPos, (float)-10f * Game22Yards.scaleFactor.widthScale, (float)47f * Game22Yards.scaleFactor.htScale);
            photoFrames[11].Position = new Vector3(SecondColCurrentXPos, (float)-10f * Game22Yards.scaleFactor.widthScale, (float)47f * Game22Yards.scaleFactor.htScale);
            photoFrames[12].Position = new Vector3(ThirdColCurrentXPos, (float)-10f * Game22Yards.scaleFactor.widthScale, (float)47f * Game22Yards.scaleFactor.htScale);

            photoFrames[4].Draw(staticCamera, Matrix.Identity);
            photoFrames[5].Draw(staticCamera, Matrix.Identity);
            photoFrames[6].Draw(staticCamera, Matrix.Identity);
            photoFrames[7].Draw(staticCamera, Matrix.Identity);
            photoFrames[8].Draw(staticCamera, Matrix.Identity);
            photoFrames[9].Draw(staticCamera, Matrix.Identity);
            photoFrames[10].Draw(staticCamera, Matrix.Identity);
            photoFrames[11].Draw(staticCamera, Matrix.Identity);
            photoFrames[12].Draw(staticCamera, Matrix.Identity);

        }

        /// <summary>
        /// Dispays the remaining bowler photoframes.
        /// </summary>
        void DispayRemainingBowlerPhotoframes()
        {
            photoFrames[13].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[14].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[15].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[16].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[17].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[18].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[19].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[20].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);
            photoFrames[21].Rotation = new Vector3(0, MathHelper.ToRadians(-15), 0);

            photoFrames[13].Position = new Vector3(FirstColCurrentXPos, (float)10f * Game22Yards.scaleFactor.widthScale, (float)39f * Game22Yards.scaleFactor.htScale);
            photoFrames[14].Position = new Vector3(SecondColCurrentXPos, (float)10f * Game22Yards.scaleFactor.widthScale, (float)39f * Game22Yards.scaleFactor.htScale);
            photoFrames[15].Position = new Vector3(ThirdColCurrentXPos, (float)10f * Game22Yards.scaleFactor.widthScale, (float)39f * Game22Yards.scaleFactor.htScale);
            photoFrames[16].Position = new Vector3(FirstColCurrentXPos, (float)0f * Game22Yards.scaleFactor.widthScale, (float)43f * Game22Yards.scaleFactor.htScale);
            photoFrames[17].Position = new Vector3(SecondColCurrentXPos, (float)0f * Game22Yards.scaleFactor.widthScale, (float)43f * Game22Yards.scaleFactor.htScale);
            photoFrames[18].Position = new Vector3(ThirdColCurrentXPos, (float)0f * Game22Yards.scaleFactor.widthScale, (float)43f * Game22Yards.scaleFactor.htScale);
            photoFrames[19].Position = new Vector3(FirstColCurrentXPos, (float)-10f * Game22Yards.scaleFactor.widthScale, (float)47f * Game22Yards.scaleFactor.htScale);
            photoFrames[20].Position = new Vector3(SecondColCurrentXPos, (float)-10f * Game22Yards.scaleFactor.widthScale, (float)47f * Game22Yards.scaleFactor.htScale);
            photoFrames[21].Position = new Vector3(ThirdColCurrentXPos, (float)-10f * Game22Yards.scaleFactor.widthScale, (float)47f * Game22Yards.scaleFactor.htScale);

            photoFrames[13].Draw(staticCamera, Matrix.Identity);
            photoFrames[14].Draw(staticCamera, Matrix.Identity);
            photoFrames[15].Draw(staticCamera, Matrix.Identity);
            photoFrames[16].Draw(staticCamera, Matrix.Identity);
            photoFrames[17].Draw(staticCamera, Matrix.Identity);
            photoFrames[18].Draw(staticCamera, Matrix.Identity);
            photoFrames[19].Draw(staticCamera, Matrix.Identity);
            photoFrames[20].Draw(staticCamera, Matrix.Identity);
            photoFrames[21].Draw(staticCamera, Matrix.Identity);

        }

    }

}